<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/10/20 10:48
 * Desc: 商城
 */
class Request_Api_V2_Malls extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function get_car_num()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));

        return $this;
    }

    public function add_car()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));

        $this->rules = [
            ['num', ['not_empty', 'digit', $this->rule_min(1)]],
            ['product_id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['suit_id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['type', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_car_list()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));

        return $this;
    }

    public function del_car()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));
        $this->rules = [
            ['car_id', ['not_empty']]
        ];

        return $this;
    }

    public function change_car_list()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));
        $this->rules = [
            ['car_id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['suit_id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_express_fee()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));
        $this->rules = [
            ['car_id', ['not_empty']],
            ['address_id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function query()
    {
        $this->rules = [
            ['page', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['suit_id', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_order_detail()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));
        $this->rules = [
            ['order_id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function add_order()
    {
        $this->validation->rule('mid', array('Rule_Member', 'need_member'));
        $this->rules = [
            ['address_id', ['digit', $this->rule_min(1)]],
            ['car_id', ['not_empty']],
            ['linkman', ['not_empty']],
            ['linktel', ['not_empty', 'phone']],
            ['linkemail', ['email']],
        ];

        return $this;
    }


}